<!--编辑/添加销量-->
<div class="dialog_content">
	<form id="info_form" action="{:U('sales/oppt')}" method="post">
    <input type="hidden" name="opttype" value="{$opptType}" />
   
	<table width="100%" class="table_form">
		<tr>
			<th>{:L('please_select')}{:L('store')} :</th>
			<td>    
                      
                <select class="mr10 J_region_select" data-pid="0" data-uri="{:U('region/ajax_getchilds',array('type'=>'store'))}" data-selected="{$info.selected_ids}"></select>
                <input type="hidden" name="regionId" id="J_region_id" value="{$search.cate_id}" />                 
            </td>
		</tr>
	  
      
		<tr>
			<th>请选择品牌 :</th>
			<td>
                <select name="brandId" id="brand_select_add">
                    <option value="">请选择品牌</option>
                    <volist name="brandList" id="item">
                        <option value="{$key}">{$item}</option>
                    </volist>
                </select>
            </td>
		</tr>
	    <tr>        
			<th>请选择机型 :</th>
			<td>
                <select name="modelId" id="model_select_add">
                    <option value="0">{:L('please_select_brand')}</option>
                    
                </select> 
			</td>
		</tr>  
 	    <tr>
			<th>IMEI :</th>
			<td>
		         <input type="text" class="input-text" name="imei" value="{$info.imei}" />
			</td>
		</tr> 
 	    <tr>
			<th>用户 :</th>
			<td>
		         <input type="text" class="input-text" name="realName" value="{$info.realName}" />
			</td>
		</tr>        
 	    
        
	</table>
	<input type="hidden" name="id" value="{$info.id}" />
	</form>
</div>
<script src="__STATIC__/js/fileuploader.js"></script>
<script>
$(function(){
	$.formValidator.initConfig({formid:"info_form",autotip:true});
	
	$('#info_form').ajaxForm({success:complate,dataType:'json'});
	function complate(result){
		if(result.status == 1){
			$.dialog.get(result.dialog).close();
            $.pinphp.tip({content:result.msg});
            window.location.reload();
		} else {
			$.pinphp.tip({content:result.msg, icon:'alert'});
		}
	}
  
     //联动查询
	$('.J_region_select').cate_select({field:"J_region_id",J_cate_select:"J_region_select"});   

$("#brand_select_add").change(function(){
   var _this = $(this);
   var brand_id = _this.val();
   var ajax_get_region = "{:U('model/getModelList')}";
   if(brand_id){
    $.ajax({
        url:ajax_get_region,
        data:"brand_id="+brand_id,
        dataType:"json",
        success:function(data){
            if(data.status==1){
                var str = '<option value="0">'+lang.please_select+'</option>';
                for(d in data.data){
                    str +='<option value="'+d+'">'+data['data'][d]+'</option>';
                }
                $("#model_select_add").html(str);
            }
        }
    });        
   }else{
        $("#model_select_add").empty();
   }                
    
}); 

});

</script>